// 两种方式: 导入mock模块
const Mock = require('mockjs')

// Mock.mock(url, method, dataTemplate)
Mock.mock('/api/userInfo', 'get', {
	code: 200,
	message: '操作成功！',
	success: true,
	data: {
		total: 100,
		'rows|100': [
			{
				'departmentId|1000000000000000008-1999999999999999999': 1,
				'departmentName|1': ['总裁办', '行政部', '人事部', '财务部', '技术部'],
				id: '1063705989926227968',
				mobile: /^1[385][1-9]\d{8}/, // 手机号
				username: '@cname', // @cname 随机生成中文名
			}
		]
	}
})

Mock.mock('/api/error', 'get', {
	code: 404,
	message: '没有资源',
	success: false
})
